package com.booza.dao;

import java.util.Collection;
import java.util.List;

import com.booza.model.Currency;
import com.booza.model.TimeZone;

/**
 * The Time zone management DAO interface.
 */
public interface ZoneDAO
{
	/**
	 * Inserts a new time zone.
	 * 
	 * @param zone
	 *          -row
	 */
	void create(TimeZone zone);

	/**
	 * Find all time zones.
	 * 
	 * @return Return list of time zones available.
	 */
	List<TimeZone> fetchAll();

	/**
	 * Updates zone details.
	 * 
	 * @param zone
	 *          -details to be updated
	 */
	void update(TimeZone zone);

	/**
	 * Find the time zone row by zone ID.
	 * 
	 * @param id
	 *          -id of the zone
	 * @return Return the matching zone.
	 */
	TimeZone findZoneById(Integer id);

	/**
	 * Find currencies available for the application. Uses currency table for this.
	 * 
	 * @return Returns a list of currencies available.
	 */
	Collection<Currency> findCurrencies();

	/**
	 * Find currency details by currency code, for example USD.
	 * 
	 * @param code
	 *          -String
	 * @return Returns the matching currency details.
	 */
	Currency findCurrencyByCode(String code);

	TimeZone findZoneByGmt(String gmt);
}
